<?php
/**
 * CreateTime: 2023/11/15 10:17
 * User:LinQ
 */
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('clients', function (Blueprint $table) {
            // 数据库基本配置
            $table->engine = 'InnoDB';
            $table->unique('client_union_id','idx_client_union_id');
            // 数据库字段
            $table->id('client_id')->comment("委托方id");
            $table->integer('com_id')->nullable(false)->comment("用户所属公司id");
            $table->string('client_name')->nullable(false)->comment("委托方姓名");
            $table->tinyInteger('cooperate_status')->nullable(false)->comment("合作状态 1、合作中2、暂停合作3、终止合作4、试案");
//            $table->string('client_contacts')->nullable(false)->comment("委托方联系方式");
            $table->string('client_code')->nullable(false)->comment("委托方标识");
            $table->string('status',50)->default(1)->nullable(false)->comment("是否删除 1是 2否 默认值为1");
            $table->integer('owner_id')->nullable(false)->comment("创建人ID");
            $table->string('client_union_id')->nullable(false)->comment("委托方唯一id");
            $table->integer('client_temp_law_file_id')->nullable()->comment("律师函模板文件id");
            $table->integer('client_temp_law_not_sign_file_id')->nullable()->comment("律师函无签名id");
            $table->integer('client_temp_law_file_import_count')->nullable()->comment("律师函模板");
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
};
